
package com.imooc.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Controller
public class AsyncController3 {
    @RequestMapping(value = "/listenable",produces = "text/plain; charset=UTF-8")
    public ListenableFuture<ResponseEntity<String>> listenableFuture() {
        ListenableFuture<ResponseEntity<String>> future =null;
   /*
        ListenableFuture<ResponseEntity<String>> future = new AsyncRestTemplate().getForEntity(
                "http://localhost:8080/index", String.class);
*/
        return future;
    }
}

